package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.entity.OrderGoodsCodeVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.time.DateUtils;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/8/23 0023
 **/
@Data
@ApiModel("编码对象")
public class CodeVo {

    @ApiModelProperty(value = "批次编码商品ID", hidden = true)
    private Long batchGoodsId;

    @NotNull(message = "商品ID不能为空")
    @ApiModelProperty(value = "商品ID", required = true)
    private Long goodsId;

    @NotNull(message = "商品规格ID不能为空")
    @ApiModelProperty(value = "商品规格ID", required = true)
    private Long goodsSpecId;

    @NotNull(message = "质保周期/天数不能为空")
    @NumberPattern(regexp = "^[1-9]\\d{0,3}$", message = "质保周期/天数必须为 >0 的正整数，且 <=4 位数", required = true)
    @ApiModelProperty(value = "质保周期/天数", required = true, example = "1")
    private Integer warrantyDay;

    @NotNull(message = "编码数量不能为空")
    @NumberPattern(regexp = "^[1-9]\\d{0,4}$", message = "编码数量必须为 >0 的正整数，且单个编码数量 <= 50000", required = true)
    @ApiModelProperty(value = "生成编码数量", required = true, example = "1")
    private Integer qty;

    @ApiModelProperty(value = "质保开始时间", hidden = true)
    private Date warrantStartTime;

    @ApiModelProperty(value = "质保开始时间", hidden = true)
    private Date warrantEndTime;

    @ApiModelProperty(value = "工单商品编码对象", hidden = true)
    private List<OrderGoodsCodeVo> goodsCodes;

    // =========================================================== //
    // =================  以下信息为配件出库时使用   ================ //
    @ApiModelProperty(value = "仓库ID", hidden = true)
    private Long storeId;

    @ApiModelProperty(value = "仓库仓位ID", hidden = true)
    private Long storeIdPositionId;

}
